/*
vue过滤器函数
黄
2017.03.16
*/

Vue.filter("mgj", function(value,keys) {
    var backinfo;
    switch(keys){
    	case 'sex':
      backinfo = 1 == value?'男':'女';
      break;
      case 'select':
      backinfo = {name:'请选择', id:0};
      break;
  }
  return backinfo;
});


Vue.filter('times',
 function(value) {
     let date = new Date(value);
     let Y = date.getFullYear(),
     m = date.getMonth() + 1,
     d = date.getDate(),
     H = date.getHours(),
     i = date.getMinutes(),
     s = date.getSeconds();
     m = m < 10?'0' + m:m;
     d = d < 10?'0' + d:d;
     H = H < 10?'0' + H:H;
     i = i < 10?'0' + i:i;
     s = s < 10?'0' + s:s;
     return Y + '-' + m + '-' + d + ' ' +H+':'+i+':'+s;
 });